import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class OverlayStyleExps extends StatelessWidget {
  const OverlayStyleExps({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () {
                SystemChrome.setSystemUIOverlayStyle(
                  SystemUiOverlayStyle.dark, // 设置为浅色主题
                );
              },
              child: const Text('light mode'),
            ),
            ElevatedButton(
              onPressed: () {
                SystemChrome.setSystemUIOverlayStyle(
                  SystemUiOverlayStyle.light, // 设置为深色主题
                );
              },
              child: const Text('dark mode'),
            ),
            ElevatedButton(
              onPressed: () {
                SystemChrome.setSystemUIOverlayStyle(
                  const SystemUiOverlayStyle(
                    statusBarColor: Colors.transparent, // 状态栏透明
                    systemNavigationBarColor: Colors.blue, // 导航栏颜色
                    systemNavigationBarIconBrightness: Brightness.light, // 导航栏图标亮度
                    statusBarIconBrightness: Brightness.light, // 状态栏图标亮度
                    statusBarBrightness: Brightness.light, // 状态栏亮度
                  ),
                );
              },
              child: const Text('custom style'),
            ),
          ],
        ),
      ),
    );
  }
}
